package com.dzx.design.structural.composite;

/**
 * @author dzx
 * @ClassName:
 * @Description: 课程类
 * @date 2019年08月08日 15:16:31
 */
public class Course extends CatalogComponent {

    private String name;
    private double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CatalogComponent catalogComponent) {
        return this.name;
    }

    @Override
    public double getPrice(CatalogComponent catalogComponent) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("Course{" +
                "name='" + name + '\'' +
                ", price=" + price +
                '}');
    }
}
